package com.fourforfo.fourmall.auth.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * 接受注册信息
 */
@Data
public class UserRegisterVO {

    @NotEmpty(message = "用户名必须提交")
    @Length(min=6,max=18,message = "用户名必须是6-18位")
    @Pattern(regexp = "^[A-Za-z].*",message = "用户名必须以字母开头")
    private String username;

    @NotEmpty(message = "用户密码不能为空")
    @Length(min=6,max=18,message = "用户密码必须是6-18位")
    private String password;

    @NotEmpty(message = "手机号不能为空")
    @Pattern(regexp = "^1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$",message = "手机号格式不正确")
    private String phone;

    @NotEmpty(message = "短信验证码不能为空")
    private String code;

}
